import logging
from logging import CRITICAL, FATAL, ERROR, WARNING, INFO, DEBUG

from .handlers import console, file_handler


def isSubLogger(name : str) -> bool:
    return len(name.split('.')) > 1


def GetLogger(name : str) -> logging.Logger:
    logger = logging.getLogger(name)
    logger.setLevel(logging.DEBUG)

    if not isSubLogger(name):
        logger.addHandler(console)
        logger.addHandler(file_handler)

    return logger
